// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const rp = require('request-promise');

// 云函数入口函数
exports.main = async (event, context) => {
  return rp(`http://v.juhe.cn/toutiao/index?type=shishang&key=ccf3712c0ab5b25ec6a10b408d77f938&start=${event.start}&count=${event.count}`)
  .then(function (res) {
      console.log(res);
      return res;
    })
    .catch(function (err) {
      console.log(err);
    });
}